home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / CHFLZ100.ZIP / CHFTYPES.PAS next >
Pascal/Delphi Source File  |  1996-09-05  |  3KB  |  131 lines

  1.  
  2. {$I LZDefine.inc}
  3.  
  4. unit ChfTypes;
  5. {type definitions for the ChiefLZ package}
  6.  
  7. interface
  8.  
  9. {$ifdef Win32}
  10. uses
  11.   SysUtils;
  12.  
  13. Type
  14. EChiefLZError    = class(Exception);
  15. EChiefLZCompress = class(EChiefLZError);
  16. EChiefLZArchive  = class(EChiefLZCompress);
  17. Type
  18. EChiefLZDLL      = class(EChiefLZError);
  19. {$endif}
  20.  
  21. Type
  22. TLZFileStr = String[12];
  23. TLZExtStr  = {$ifdef Win32} string {$else} String[4]  {$endif};
  24. TLZPathStr = {$ifdef Win32} string {$else} String[80] {$endif};
  25. TLZSigStr  = String[18];
  26. TLZVerStr  = String[8];
  27.  
  28. Type
  29. TLZReportRec = packed Record
  30. {any version information?}
  31.    FileVersion: TLZVerStr;
  32. {compressed sizes}
  33.    Sizes: LongInt;
  34. {uncompressed sizes}
  35.    uSizes:LongInt;
  36. {date/time stamps}
  37.    Times: LongInt;
  38. {file names}
  39.    Names: TLZPathStr;
  40. {is it a Directory?}
  41.    IsDir: Boolean; {introduced this for LZ report and Question procedures}
  42. end;
  43.  
  44. Type
  45. TLZReportProc=Procedure(Const aName:TLZReportRec{String};Const aSize:LongInt);
  46. {procedural type for status/progress information
  47.             aName=file record information
  48.             aSize=filesize (compressed)
  49. }
  50.  
  51. Type
  52. TLZReply = (LZNo, LZYes, LZQuit);
  53. TLZQuestionFunc=Function(const aName: TLZReportRec;Const aExist:string): TLZReply;
  54. {optionally used by the LZOBJ object;
  55.  
  56. procedural type to ask whether an existing file should
  57. be overwritten - the filename is sent to your function
  58. in "aName" - your function should return TRUE if you
  59. want the file to be overwritten. If no function is pointed
  60. to, the default is to overwrite existing files.
  61. }
  62.  
  63. Type
  64. TLZRenameFunc = function(var Name: string): boolean;
  65. {
  66.   Function type to determine whether to abort a file operation,
  67.   or rename the file.
  68. }
  69.  
  70. {header for ChiefLZ archives}
  71. Const
  72. MaxChiefLZArchiveSize =
  73. {$ifndef Win32}
  74. 600; {max number of files in archives: absolute max for 16-bit is 606}
  75. {$else Win32}
  76. 2048;{max number of files in archives - let's use more for Win32}
  77. {$endif Win32}
  78. Const
  79. MaxChiefLZDirectories = (MaxChiefLZArchiveSize div 2);
  80.  
  81.  
  82. Type
  83. TLZFileRec= packed Record
  84. {is it a directory?}
  85.        IsDir: Boolean;
  86. {its directory ID}
  87.        DirID: Word;
  88. {its parent directory ID}
  89.        ParentDir: Word;
  90. {any version information?}
  91.        FileVersion : TLZVerStr;
  92. {is it compressed?}
  93.        Compressed:Boolean;
  94. {compressed sizes}
  95.        Sizes: LongInt;
  96. {uncompressed sizes}
  97.        uSizes:LongInt;
  98. {date/time stamps}
  99.        Times: LongInt;
  100. {file names}
  101.        Names: TLZFileStr;
  102. end;
  103.  
  104. Type TLZCount = Word;
  105. Type TLZRecurse = (LZNoRecurse, LZRecurseOnce, LZFullRecurse);
  106.  
  107. TLZArchiveHeader = packed Record
  108. {Chief signature}
  109.    Signature: TLZSigStr;
  110.    Count:     TLZCount
  111. end;
  112.  
  113. Type
  114. PChiefLZArchiveHeader = ^TChiefLZArchiveHeader;
  115. TChiefLZArchiveHeader = packed Record
  116.    Count : TLZCount;
  117.    Files : Array[1..MaxChiefLZArchiveSize] of TLZFileRec
  118. end;
  119.  
  120. Type
  121. {$ifDef Win32}
  122. StrType=String;
  123. {$else}
  124. StrType=Array[0..255] of char;
  125. {$endif}
  126.  
  127. implementation
  128.  
  129. end.
  130.  
  131.